
<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="utf-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    <!-- 上述3个meta标签*必须*放在最前面，任何其他内容都*必须*跟随其后！ -->
    <meta name="description" content="">
    <meta name="author" content="hzcmgd">
    <title>树人学习</title>
    <link rel="icon" href="favicon.ico">
    <title>Off Canvas Template for Bootstrap</title>
    <!-- Bootstrap core CSS -->
    <link href="https://cdn.bootcss.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet">
    <!-- IE10 viewport hack for Surface/desktop Windows 8 bug -->
    <link href="http://v3.bootcss.com/assets/css/ie10-viewport-bug-workaround.css" rel="stylesheet">
    <!-- Custom styles for this template -->
    <link href="/static/pc/cmgd3.css" rel="stylesheet">
    <link rel="stylesheet" href="/static/pc/swiper.3.2.0.min.css">

    <!-- Just for debugging purposes. Don't actually copy these 2 lines! -->
    <!--[if lt IE 9]><script src="http://v3.bootcss.com/assets/js/ie8-responsive-file-warning.js"></script><![endif]-->
    <script src="http://v3.bootcss.com/assets/js/ie-emulation-modes-warning.js"></script>

    <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
    <!--[if lt IE 9]>
    <script src="https://cdn.bootcss.com/html5shiv/3.7.3/html5shiv.min.js"></script>
    <script src="https://cdn.bootcss.com/respond.js/1.4.2/respond.min.js"></script>
    <![endif]-->
    <script src="/static/admin/js/jquery.min.js?v=2.1.4"></script>
    <script src="/static/admin/js/jquery.form.js"></script>
    <script src="/static/admin/js/plugins/layer/laydate/laydate.js"></script>
    <script src="/static/pc/js/layer/layer.js"></script>
    <script src="/static/admin/js/laypage/laypage.js"></script>
    <script src="/static/admin/js/laytpl/laytpl.js"></script>
    <link href="/static/admin/css/font-awesome.min.css?v=4.4.0" rel="stylesheet">

    <style>
        body{font-family: 'Microsoft Yahei';}
        .media-body a{text-decoration:none;color:#000;}

        a.list-group-item, button.list-group-item {
            color: #fff;
        }

        .list-group-item:hover{
            background-color:rgb(163, 185, 214);
        }

        .list-group-item{font-size:17px;word-spacing: 10px; background:none;   letter-spacing: 2px;border:0px;color: #fff; margin-bottom: 0px;}

        .list-group{height:1253px;background:rgba(14, 24, 35, 0.25);}


        .list-group-item.active, .list-group-item.active:focus, .list-group-item.active:hover {
            z-index: 2;
            color: #fff;
            background-color:rgb(163, 185, 214);
            border-color:  rgba(14, 24, 35, 0.25);
        }

        .panel-primary>.panel-heading {
            color: #000;
            background-color: #fff;
            border-color: #fff;
        }
        .dynamic{margin-bottom:15px; background: #fff; border-radius: 8px;padding-top: 5px;}
        .media-heading{font-family: 'Microsoft Yahei';}
        .col-xs-6,.col-sm-2{padding-right: 0px;}
        .col-xs-12, .col-sm-7{padding-right: 0px;}
        .panel-heading{font-family: 'Microsoft Yahei';}
        .panel-primary {
            border-color: #fff;

        }

        .dy_img {width:100%;padding:5px 15px; margin:0 auto;height: 220px;}
        .dy_img li {float:left;width:33.3%;list-style-type:none; padding: 5px 10px 5px 0; }
        .dy_img li img{width:100%; }
         .dy_share{padding: 8px 0;background:#f5f5f5; padding:5px 25px;}
        .dy_share_img {width:100%;padding:5px 0;height: 180px;}
        .dy_share_img li {float:left;width:27.3%;list-style-type:none; padding: 5px 10px 5px 0; }
        .dy_share_img li img{width:100%; }
        .dy_desc2{ height: 30px;line-height: 30px;}
        .dy_desc2 i{width: 32%;text-align: center;}
        .dy_desc1 span{margin-left:10px;}
    </style>
</head>

<body>
{include file="public/header" /}

<div class="container body_bg">

    <div class="row row-offcanvas row-offcanvas-right">
        <div class="col-xs-6 col-sm-2 sidebar-offcanvas" id="sidebar">
            <div class="list-group">
                <a href="{:url('index/index')}" class="list-group-item active"><i class="fa fa-bullseye"></i>首页</a>
                <a href="{:url('article/article')}" class="list-group-item"><i class="fa fa-bookmark-o"></i>日常文章</a>
                <!--<a href="#" class="list-group-item">动态</a>-->
                <a href="{:url('article/debate')}" class="list-group-item"><i class="fa  fa-comment-o"></i>话题中心</a>
                <!--<a href="#" class="list-group-item">机构</a>-->
                <a href="{:url('article/essay')}" class="list-group-item" ><i class="fa fa-circle-thin"></i>机构征文</a>
                <a href="" class="list-group-item"><i class="fa fa-circle"></i>全部机构</a>
            </div>
        </div><!--/.sidebar-offcanvas-->
        <div class="col-xs-12 col-sm-7">
            <!--<div class="jumbotron_swiper">-->
                <!--&lt;!&ndash;轮播图&ndash;&gt;-->
                <!--<div class="swiper-container">-->
                    <!---->
                    <!--<div class="swiper-pagination"></div>-->
                <!--</div>-->
            <!--</div>-->

            <div class="panel panel-primary" style="margin-top: 10px;margin-bottom: 10px; background: none; border:0px;">

                <script id="list-template" type="text/html">
                    {{# for(var i=0;i<d.length;i++){  }}
                    <div class="dynamic">
                        <div class="dy_desc" style="padding: 3px 15px; height:50px;">
                            <div class="dy_desc1" style="float: left;height:50px;line-height:50px;width: 50%;">
                                <div style="width: 60px;float:left;">
                                    <img src="/uploads/face/{{d[i].head_img}}" style="width:50px;height:50px; border-radius: 50%;">
                                </div>
                                <div style="width:200px;float:left;">
                                    <p style="height: 25px;line-height: 25px;padding: 0; margin: 0;">{{d[i].nickname}}</p>
                                    <p style="height: 25px;line-height: 25px;padding: 0; margin: 0;">{{d[i].addtime}}</p>
                                </div>
                            </div>
                        </div>


                        <div style="padding: 5px 15px 0 15px;">{{d[i].content}}</div>
                        {{# if(d[i].img!=''){ }}
                        <div class="dy_img">
                            {{# for(var k=0;k< d[i].imgs.length;k++){  }}
                            <li><img src="/uploads/images/{{d[i].imgs[k].imgpath}}"  > </li>
                            {{# } }}


                        </div>
                        {{# } }}


                        {{# if(d[i].share_id>0){ }}

                        <div class="dy_share">
                            <p>@{{d[i].sharename}}</p>
                            <div>{{d[i].sharecontent}}</div>
                            {{# if(d[i].share_img!=''){ }}
                            <div class="dy_share_img">
                                {{# for(var q=0;q< d[i].share_imgs.length;q++){  }}
                                <li><img src="/uploads/images/{{d[i].share_imgs[q].imgpath}}"  > </li>
                                {{# } }}
                            </div>
                            {{# } }}
                        </div>
                        {{# } }}

                        <div class="dy_desc" style="padding: 3px 15px; height:35px;">
                            <div class="dy_desc2" style="float: left;;width: 100%;text-align: right;">
                                <i class="fa fa-external-link" style="border-right: 1px #ccc solid;">{{d[i].shares}}</i>
                                <i class="fa  fa-comment-o" style="border-right: 1px #ccc solid;">{{d[i].pinglun}}</i>
                                <a class="weui-form-preview__btn weui-form-preview__btn_default no"
                                   onclick="thumbsUp('{{d[i].id}}',this)">  <i class="fa  {{# if(d[i].is_zan==1){ }}fa-thumbs-up{{# }else{ }}fa-thumbs-o-up{{# } }}"   id="zan_{{d[i].id}}" >{{d[i].zan}}</i> </a>
                            </div>
                        </div>
                    </div>


                    {{# } }}
                </script>
                <div id="list-content"></div>
            </div>
        </div>
        <div class="col-sm-3">




            {if condition="$user_info.is_login==1"}
            <div class="panel panel-primary" style="margin-bottom: 11px;">
                <div class="panel-body">

                    <div style="height:100px;">
                        <div class="l-bg bg-blur" style="background: url('/uploads/face/{$user_info.member.head_img}');"></div>
                        <div class="content-front">
                            <a href="{:url('user/center')}"><img src="/uploads/face/{$user_info.member.head_img}"></a>
                        </div>
                    </div>
                    <hr>
                    <div>
                        <p><h5  class="text-center">   <a href="{:url('user/center')}">{$user_info.member.nickname} </a> {if condition="$user_info.member.group_id == 8"} <span class="label label-warning">V</span>{/if}</h5></p>

                    </div>
                    <div>
                        <div class="row text-center">
                            <div class="col-md-4">
                                <p><h4>{$user_info.foucs_num}</h4></p>
                                <p>关注</p>
                            </div>
                            <div class="col-md-4 line-u">
                                <p><h4>{$user_info.fans_num}</h4></p>
                                <p>粉丝</p>
                            </div>
                            <div class="col-md-4">
                                <p><h4>{$user_info.total}</h4></p>
                                <p>文章</p>
                            </div>
                        </div>
                    </div>



                </div>
            </div>

            {/if}

            <div class="panel panel-primary">
                <div class="panel-heading" style="font-size:16px;font-weight: 600;word-spacing:10px; padding-bottom: 0px; margin-bottom: 0px;    letter-spacing: 2px;">
                    <em class="c-line"></em> 最新机构
                </div>
                <div class="panel-body" style="padding: 5px;">

                    {foreach name="new_instit" id="vt"}
                    <div style="padding: 10px 0;height: 70px;">
                        <div style="float: left ;width: 25%;">

                            <img src="/uploads/face/{$vt.head_img}" style="width:50px;height:50px;border-radius: 50%; ">

                        </div>

                        <div style="float: left;width: 75%;">
                            <div style="height:25px;line-height:25px; overflow: hidden;">{$vt.nickname}</div>
                            <div  style="height:25px;line-height:25px;overflow: hidden;color:#878787;font-size: 12px;">{$vt.desc}</div>
                        </div>


                    </div>
                    {/foreach}

                </div>
            </div>

            <!--<div class="panel panel-primary">-->
            <!--<div class="panel-heading">-->
            <!--<h3 class="panel-title">市级排行</h3>-->
            <!--</div>-->
            <!--<div class="panel-body">-->
            <!--<p><span class="number">1</span> Lowercased text.</p>-->
            <!--<p><span class="number">2</span> Lowercased text.</p>-->
            <!--<p><span class="number">3</span> Lowercased text.</p>-->
            <!--<p><span class="number">4</span> Lowercased text.</p>-->
            <!--</div>-->
            <!--</div>-->

        </div>
    </div><!--/row-->

    <hr>



</div><!--/.container-->

<script type="text/javascript">


    var ccc =1;
    Ajaxpage();
    $(window).scroll(
            function() {
                var scrollTop = $(this).scrollTop();
                var scrollHeight = $(document).height();
                var windowHeight = $(this).height();
                if (scrollTop + windowHeight == scrollHeight) {
                    console.log(3);
                    Ajaxpage();
                }
            });

    function Ajaxpage(){
        $.post('{:url("index/dynamic")}', {page:ccc}, function(data){
            //  $(".spiner-example").css('display','none'); //数据加载完关闭动画
            console.log(1);
            console.log(data);
            console.log(2);
            if(data==''){
                // $("#list-content").html('<td colspan="20" style="padding-top:10px;padding-bottom:10px;font-size:16px;text-align:center">暂无数据</td>');
            }else{
                var tpl = document.getElementById('list-template').innerHTML;
                laytpl(tpl).render(data, function(html){
                    // document.getElementById('list-content').innerHTML = html;
                    $('#list-content').append(html);
                    $('.weui-grid__icon').css('height',$('.weui-grid__icon').css('width'));
                    ccc++;
                });
            }
        });
    }

    $(function(){





        var $searchBar = $('#searchBar'),
                $searchResult = $('#searchResult'),
                $searchText = $('#searchText'),
                $searchInput = $('#searchInput'),
                $searchClear = $('#searchClear'),
                $searchCancel = $('#searchCancel');

        function hideSearchResult(){
            $searchResult.hide();
            $searchInput.val('');
        }
        function cancelSearch(){
            hideSearchResult();
            $searchBar.removeClass('weui-search-bar_focusing');
            $searchText.show();
        }

        $searchText.on('click', function(){
            $searchBar.addClass('weui-search-bar_focusing');
            $searchInput.focus();
        });
        $searchInput
                .on('blur', function () {
                    if(!this.value.length) cancelSearch();
                })
                .on('input', function(){
                    if(this.value.length) {
                        $searchResult.show();
                    } else {
                        $searchResult.hide();
                    }
                })
        ;
        $searchClear.on('click', function(){
            hideSearchResult();
            $searchInput.focus();
        });
        $searchCancel.on('click', function(){
            cancelSearch();
            $searchInput.blur();
        });
    });
    //顶部导航
    $(function(){
        $('.weui-navbar__item').on('click', function () {
            $(this).addClass('weui-bar__item_on').siblings('.weui-bar__item_on').removeClass('weui-bar__item_on');

            var cc = $(this).text();
            if(cc=='官方动态'){
                $("#wzzx").hide();
                $("#gfdt").show();

            }
            if(cc=='文章中心'){
                $("#wzzx").show();
                $("#gfdt").hide();

            }
        });
    });
    //    //底部导航
    //    $(function(){
    //        $('.weui-tabbar__item').on('click', function () {
    //            $(this).addClass('weui-bar__item_on').siblings('.weui-bar__item_on').removeClass('weui-bar__item_on');
    //        });
    //    });

    //点赞
    function thumbsUp(id,obj){

        var t = '#zan_'+id;
        count = $(t).html();
        $.post('{:url("index/dynamic_zan")}',
                {id:id},
                function(data){
                    if(data.code==11){
                        layer.msg(data.msg,{icon:5,time:1500,shade: 0.1,});
                        window.location.href="{:url('user/login')}";
                    }else {

                        count = parseInt(count);


                        if(data.code==1){
                            count = count+1;
                            $('#zan_'+id).removeClass('fa-thumbs-o-up');
                            $('#zan_'+id).addClass('fa-thumbs-up');
                            $('#zan_'+id).html(count);
                        }else{
                            count = count-1;
                            $('#zan_'+id).removeClass('fa-thumbs-up');
                            $('#zan_'+id).addClass('fa-thumbs-o-up');
                            $('#zan_'+id).html(count);
                        }
                    }

                });







    }

    function comment(id,obj){
        var t = '#pl_'+id;
        var st = $(t).css('display');
        if(st=='none'){
            $('.comment').css('display','none');
            $(t).css('display','block');
        }else{
            $(t).css('display','none');
        }
    }


    function addemoji(i,j){
        var htl = "<img src='/static/emoji/img/"+i+".gif'>";
        $("#comment_"+j).append(htl);
    }



    function shares(id){

        location.href = '/index/usercenter/send_info/share_id/'+id+'.html';
    }

    function showemoji(id){
        var t = '#emoji_'+id;
        var st = $(t).css('display');
        if(st=='none'){
            $('.emoji').css('display','none');
            $(t).css('display','block');
        }else{
            $(t).css('display','none');
        }
    }





</script>


</body>
</html>
